﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Intrinsics.X86;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// MSKU利润报表
    /// </summary>
    /// 

    public class ProfitMSKUDTO
    {
        public string code { get; set; }
        public string msg { get; set; }
        public data_ProfitMSKU data { get; set; }

    }

    public class data_ProfitMSKU
    {
        public List<ProfitMSKU> records { get; set; }
        public string total { get; set; }
        public string size { get; set; }
        public int current { get; set; }
        public bool optimizeCountSql { get; set; }
        public bool hitCount { get; set; }
        public object countId { get; set; }
        public object maxLimit { get; set; }
        public int pages { get; set; }
    }
    public class ProfitMSKU
    {
        
        public string RowId { get; set; }
        public string id { get; set; }
        /// <summary>
        /// 日期
        /// </summary>
        public string dataDate { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        //public string smallImageUrl { get; set; }

        /// <summary>
        /// msku
        /// </summary>
        public string msku { get; set; }
        /// <summary>
        /// asin
        /// </summary>
        public string asin { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public string sid { get; set; }
        /// <summary>
        /// 店铺
        /// </summary>
        public string storeName { get; set; }
        /// <summary>
        /// 国家编码
        /// </summary>
        public string countryCode { get; set; }
        /// <summary>
        /// 国家
        /// </summary>
        public string country { get; set; }
        /// <summary>
        /// 品名
        /// </summary>
        public string localName { get; set; }
        /// <summary>
        /// sku
        /// </summary>
        public string localSku { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string itemName { get; set; }
        /// <summary>
        /// 负责人
        /// </summary>
        public string principalRealname { get; set; }
        /// <summary>
        /// listing标签id
        /// </summary>
        public string listingTagIds { get; set; }
        /// <summary>
        /// 分类
        /// </summary>
        public string categoryName { get; set; }
        /// <summary>
        /// 品牌
        /// </summary>
        public string brandName { get; set; }
        /// <summary>
        /// 币种
        /// </summary>
        public string currencyCode { get; set; }
        /// <summary>
        /// 币种符号
        /// </summary>
        public string currencyIcon { get; set; }
        /// <summary>
        /// fba/fbm销量总数
        /// </summary>
        public string totalFbaAndFbmQuantity { get; set; }

        /// <summary>
        /// fba/fbm销售额总数
        /// </summary>
        public string totalFbaAndFbmAmount { get; set; }

        /// <summary>
        /// 销量
        /// </summary>
        public string totalSalesQuantity { get; set; }
        /// <summary>
        /// FBA销量
        /// </summary>
        public string fbaSalesQuantity { get; set; }

        /// <summary>
        /// FBM销量	
        /// </summary>
        public string fbmSalesQuantity { get; set; }
        /// <summary>
        /// 补换货量
        /// </summary>
        public string totalReshipQuantity { get; set; }
        /// <summary>
        /// FBM补（换）货量	
        /// </summary>
        public string reshipFbmProductSalesQuantity { get; set; }
        /// <summary>
        /// FBM补（换）货退回量
        /// </summary>
        public string reshipFbmProductSaleRefundsQuantity { get; set; }
        /// <summary>
        /// FBA补（换）货量
        /// </summary>
        public string reshipFbaProductSalesQuantity { get; set; }

        /// <summary>
        /// FBA补（换）货退回量
        /// </summary>
        public string reshipFbaProductSaleRefundsQuantity { get; set; }

        /// <summary>
        /// 多渠道销量
        /// </summary>
        public string mcFbaFulfillmentFeesQuantity { get; set; }

        /// <summary>
        /// 广告销售额	
        /// </summary>
        public string totalAdsSales { get; set; }

        /// <summary>
        /// sd广告销售额	
        /// </summary>
        public string adsSdSales { get; set; }

        /// <summary>
        /// sp广告销售额	
        /// </summary>
        public string adsSpSales { get; set; }


        /// <summary>
        /// 广告销量	
        /// </summary>
        public string totalAdsSalesQuantity { get; set; }

        /// <summary>
        /// sd广告销量	
        /// </summary>
        public string adsSdSalesQuantity { get; set; }

        /// <summary>
        /// sp广告销量
        /// </summary>
        public string adsSpSalesQuantity { get; set; }
        /// <summary>
        /// 销售额
        /// </summary>
        public string totalSalesAmount { get; set; }
        /// <summary>
        /// FBA销售额
        /// </summary>
        public string fbaSaleAmount { get; set; }
        /// <summary>
        /// FBM销售额
        /// </summary>
        public string fbmSaleAmount { get; set; }

        /// <summary>
        /// 含税销售额
        /// </summary>
        public string totalSalesAmountWithTax { get; set; }

        /// <summary>
        /// 买家运费
        /// </summary>
        public string shippingCredits { get; set; }
        /// <summary>
        /// 促销折扣
        /// </summary>
        public string promotionalRebates { get; set; }
        /// <summary>
        /// FBA库存赔偿
        /// </summary>
        public string fbaInventoryCredit { get; set; }
        /// <summary>
        /// COD
        /// </summary>
        public string cashOnDelivery { get; set; }
        /// <summary>
        /// 其他收入
        /// </summary>
        public string otherInAmount { get; set; }
        /// <summary>
        /// 包装收入
        /// </summary>
        public string giftWrapCredits { get; set; }

        /// <summary>
        /// 买家交易保障索赔额
        /// </summary>
        public string guaranteeClaims { get; set; }
        /// <summary>
        /// 积分抵减收入
        /// </summary>
        public string costOfPoIntegersGranted { get; set; }
        /// <summary>
        /// 清算收入
        /// </summary>
        public string fbaLiquidationProceeds { get; set; }

        /// <summary>
        /// 清算调整
        /// </summary>
        public string fbaLiquidationProceedsAdjustments { get; set; }

        /// <summary>
        /// 亚马逊运费赔偿
        /// </summary>
        public string amazonShippingReimbursement { get; set; }

        /// <summary>
        /// Safe-T索赔
        /// </summary>
        public string safeTReimbursement { get; set; }

        /// <summary>
        /// Netco交易
        /// </summary>
        public string netcoTransaction { get; set; }

        /// <summary>
        /// 赔偿收入
        /// </summary>
        public string reimbursements { get; set; }

        /// <summary>
        /// 追索收入
        /// </summary>
        public string clawbacks { get; set; }


        /// <summary>
        /// 混合VAT收入
        /// </summary>
        public string sharedComminglingVatIncome { get; set; }
        /// <summary>
        /// 其他
        /// </summary>
        public string others { get; set; }

        /// <summary>
        /// 收入退款额
        /// </summary>
        public string totalSalesRefunds { get; set; }
        /// <summary>
        /// FBA销售退款额
        /// </summary>
        public string fbaSalesRefunds { get; set; }
        /// <summary>
        /// FBM销售退款额
        /// </summary>
        public string fbmSalesRefunds { get; set; }
        /// <summary>
        /// 买家运费退款额
        /// </summary>
        public string shippingCreditRefunds { get; set; }
        /// <summary>
        /// 买家包装退款额
        /// </summary>
        public string giftWrapCreditRefunds { get; set; }
        /// <summary>
        /// 买家拒付
        /// </summary>
        public string chargebacks { get; set; }
        /// <summary>
        /// 积分抵减退回
        /// </summary>
        public string costOfPoIntegersReturned { get; set; }
        /// <summary>
        /// 促销折扣退款额
        /// </summary>
        public string promotionalRebateRefunds { get; set; }
        /// <summary>
        /// 费用退款额
        /// </summary>
        public string totalFeeRefunds { get; set; }
        /// <summary>
        /// 平台费退款额
        /// </summary>
        public string sellingFeeRefunds { get; set; }
        /// <summary>
        /// 发货费退款额
        /// </summary>
        public string fbaTransactionFeeRefunds { get; set; }
        /// <summary>
        /// 交易费用退款额
        /// </summary>
        public string refundAdministrationFees { get; set; }
        /// <summary>
        /// 其他订单费退款额
        /// </summary>
        public string otherTransactionFeeRefunds { get; set; }
        /// <summary>
        /// 广告退款额
        /// </summary>
        public string refundForAdvertiser { get; set; }
        /// <summary>
        /// 积分费用
        /// </summary>
        public string pointsAdjusted { get; set; }
        /// <summary>
        /// 运输标签费退款
        /// </summary>
        public string shippingLabelRefunds { get; set; }
        /// <summary>
        /// 退款量
        /// </summary>
        public string refundsQuantity { get; set; }
        /// <summary>
        /// 退款率
        /// </summary>
        public string refundsRate { get; set; }
        /// <summary>
        /// 退货量
        /// </summary>
        public string fbaReturnsQuantity { get; set; }
        /// <summary>
        /// 退货量（可售）
        /// </summary>
        public string fbaReturnsSaleableQuantity { get; set; }
        /// <summary>
        /// 退货量（不可售）
        /// </summary>
        public string fbaReturnsUnsaleableQuantity { get; set; }
        /// <summary>
        /// 平台费
        /// </summary>
        public string platformFee { get; set; }
        /// <summary>
        /// FBA发货费
        /// </summary>
        public string fbaDeliveryFee { get; set; }

        /// <summary>
        /// 其他订单费用
        /// </summary>
        public string otherTransactionFees { get; set; }
        /// <summary>
        /// 广告费
        /// </summary>
        public string totalAdsCost { get; set; }
        /// <summary>
        /// SP广告费
        /// </summary>
        public string adsSpCost { get; set; }
        /// <summary>
        /// SB广告费
        /// </summary>
        public string adsSbCost { get; set; }
        /// <summary>
        /// SBV广告费
        /// </summary>
        public string adsSbvCost { get; set; }
        /// <summary>
        /// SD广告费
        /// </summary>
        public string adsSdCost { get; set; }
        /// <summary>
        /// 差异分摊
        /// </summary>
        public string sharedCostOfAdvertising { get; set; }
        /// <summary>
        /// 推广费
        /// </summary>
        public string promotionFee { get; set; }
        /// <summary>
        /// 订阅费
        /// </summary>
        public string sharedSubscriptionFee { get; set; }
        /// <summary>
        /// 秒杀费
        /// </summary>
        public string sharedLdFee { get; set; }
        /// <summary>
        /// 优惠卷
        /// </summary>
        public string sharedCouponFee { get; set; }
        /// <summary>
        /// 早期评论人计划
        /// </summary>
        public string sharedEarlyReviewerProgramFee { get; set; }
        /// <summary>
        /// vine
        /// </summary>
        public string sharedVineFee { get; set; }
        /// <summary>
        /// FBA仓储费
        /// </summary>
        public string totalStorageFee { get; set; }
        /// <summary>
        /// 月度仓库费
        /// </summary>
        public string fbaStorageFee { get; set; }
        /// <summary>
        /// 月度仓储费差异
        /// </summary>
        public string sharedFbaStorageFee { get; set; }
        /// <summary>
        /// 长期仓储费
        /// </summary>
        public string longTermStorageFee { get; set; }
        /// <summary>
        /// 长期仓储费差异
        /// </summary>
        public string sharedLongTermStorageFee { get; set; }
        /// <summary>
        /// 库存续订费用
        /// </summary>
        public string sharedStorageRenewalBilling { get; set; }
        /// <summary>
        /// FBA销毁费
        /// </summary>
        public string sharedFbaDisposalFee { get; set; }
        /// <summary>
        /// FBA移除费
        /// </summary>
        public string sharedFbaRemovalFee { get; set; }
        /// <summary>
        /// 入仓手续费
        /// </summary>
        public string sharedFbaInboundTransportationProgramFee { get; set; }
        /// <summary>
        /// 标签费
        /// </summary>
        public string sharedLabelingFee { get; set; }
        /// <summary>
        /// 塑料包装费
        /// </summary>
        public string sharedPolybaggingFee { get; set; }
        /// <summary>
        /// 泡沫包装费
        /// </summary>
        public string sharedBubblewrapFee { get; set; }
        /// <summary>
        /// 胶带费
        /// </summary>
        public string sharedTapingFee { get; set; }
        /// <summary>
        /// FBA卖家退回费
        /// </summary>
        public string sharedFbaCustomerReturnFee { get; set; }
        /// <summary>
        /// 计划外服务费
        /// </summary>
        public string sharedFbaInboundDefectFee { get; set; }
        /// <summary>
        /// 超量仓储费
        /// </summary>
        public string sharedFbaOverageFee { get; set; }
        /// <summary>
        /// 合作承运费
        /// </summary>
        public string sharedAmazonPartneredCarrierShipmentFee { get; set; }
        /// <summary>
        /// 合仓费
        /// </summary>
        public string sharedFbaInboundConvenienceFee { get; set; }
        /// <summary>
        /// 库存调整费用
        /// </summary>
        public string sharedItemFeeAdjustment { get; set; }

        /// <summary>
        /// 其他仓储费
        /// </summary>
        public string sharedOtherFbaInventoryFees { get; set; }
       
        /// <summary>
        /// FBA国际物流货运费
        /// </summary>
        public string sharedFbaIntegerernationalInboundFee { get; set; }
        /// <summary>
        /// 调整费用
        /// </summary>
        public string adjustments { get; set; }
        /// <summary>
        /// 平台其他费
        /// </summary>
        public string totalPlatformOtherFee { get; set; }
        /// <summary>
        /// 运输标签费
        /// </summary>
        public string shippingLabelPurchases { get; set; }
        /// <summary>
        /// 信用卡扣款
        /// </summary>
        public string sharedChargesToCreditCard { get; set; }
        /// <summary>
        /// 承运人装运标签调整费
        /// </summary>
        public string sharedCarrierShippingLabelAdjustments { get; set; }
        /// <summary>
        /// 清算费
        /// </summary>
        public string sharedLiquidationsFees { get; set; }
        /// <summary>
        /// 人工处理费用
        /// </summary>
        public string sharedManualProcessingFee { get; set; }
        /// <summary>
        /// 其他服务费
        /// </summary>
        public string sharedOtherServiceFees { get; set; }
        /// <summary>
        /// 销售税
        /// </summary>
        public string totalSalesTax { get; set; }
        
        /// <summary>
        /// VAT/GST
        /// </summary>
        public string taxCollected { get; set; }
        /// <summary>
        /// TCS-IGST
        /// </summary>
        public string tcsIgstCollected { get; set; }
        /// <summary>
        /// TCS-SGST
        /// </summary>
        public string tcsSgstCollected { get; set; }
        /// <summary>
        /// TCS-CGST
        /// </summary>
        public string tcsCgstCollected { get; set; }
        /// <summary>
        /// 混合VAT
        /// </summary>
        public string sharedComminglingVatExpenses { get; set; }
        /// <summary>
        /// 销售税调整
        /// </summary>
        public string sharedTaxAdjustment { get; set; }
        /// <summary>
        /// 销售税退款额
        /// </summary>
        public string salesTaxRefund { get; set; }
        /// <summary>
        /// VAT/GST
        /// </summary>
        public string taxRefunded { get; set; }
        /// <summary>
        /// TCS-IGST
        /// </summary>
        public string tcsIgstRefunded { get; set; }
        /// <summary>
        /// TCS-SGST
        /// </summary>
        public string tcsSgstRefunded { get; set; }
        /// <summary>
        /// TCS-CGST
        /// </summary>
        public string tcsCgstRefunded { get; set; }
        /// <summary>
        /// 市场税
        /// </summary>
        public string salesTaxWithheld { get; set; }
        /// <summary>
        /// 市场税退款额
        /// </summary>
        public string refundTaxWithheld { get; set; }
        /// <summary>
        /// 混合网路费用
        /// </summary>
        public string tdsSection194ONet { get; set; }
        /// <summary>
        /// 订单其他费
        /// </summary>
        public string customOrderFee { get; set; }
        /// <summary>
        /// 站外推广费-本金
        /// </summary>
        public string customOrderFeePrincipal { get; set; }
        /// <summary>
        /// 站外推广费-佣金
        /// </summary>
        public string customOrderFeeCommission { get; set; }
        /// <summary>
        /// 预估费用
        /// </summary>
        public List<estimateFeeStr> estimateFeeStr { get; set; }

        /// <summary>
        /// 采购成本
        /// </summary>
        public string cgPrice { get; set; }
        /// <summary>
        /// 是否有采购成本明细
        /// </summary>
        public string hasCgPriceDetail { get; set; }
        /// <summary>
        /// 采购单价
        /// </summary>
        public string cgUnitPrice { get; set; }
        /// <summary>
        /// 采购占比
        /// </summary>
        public string proportionOfCg { get; set; }
        /// <summary>
        /// 头程运费
        /// </summary>
        public string cgTransportCosts { get; set; }
        /// <summary>
        /// 是否有物流（头程）成本明细
        /// </summary>
        public string hasCgTransportCostsDetail { get; set; }
        /// <summary>
        /// 头程单价
        /// </summary>
        public string firstTripUnitPrice { get; set; }
        /// <summary>
        /// 头程占比
        /// </summary>
        public string proportionOfCgTransport { get; set; }
        /// <summary>
        /// 其他成本
        /// </summary>
        public string cgOtherCostsTotal { get; set; }
        /// <summary>
        /// 其他单价
        /// </summary>
        public string cgOtherUnitCosts { get; set; }
        /// <summary>
        /// 是否有其他成本明细
        /// </summary>
        public string hasCgOtherCostsDetail { get; set; }
        /// <summary>
        /// 其他成本占比
        /// </summary>
        public string proportionOfCgOtherCosts { get; set; }
        /// <summary>
        /// 合计成本
        /// </summary>
        public string totalCost { get; set; }
        /// <summary>
        /// 合计成本占比
        /// </summary>
        public string proportionOfTotalCost { get; set; }
        /// <summary>
        /// 毛利润
        /// </summary>
        public string grossProfit { get; set; }

        /// <summary>
        /// 含税毛利润
        /// </summary>
        public string grossProfitWithTax { get; set; }

        /// <summary>
        /// 毛利率
        /// </summary>
        public string grossRate { get; set; }
        /// <summary>
        /// 含税毛利率
        /// </summary>
        public string grossRateWithTax { get; set; }
        /// <summary>
        /// 销售税-礼品包装税
        /// </summary>
        public string taxCollectedGiftWrap { get; set; }
        /// <summary>
        /// 销售税-买家运费税
        /// </summary>
        public string taxCollectedShipping { get; set; }
        /// <summary>
        /// 销售税-促销折扣税
        /// </summary>
        public string taxCollectedDiscount { get; set; }
        /// <summary>
        /// 销售税-商品价格税
        /// </summary>
        public string taxCollectedProduct { get; set; }
        /// <summary>
        /// 销售税退款-礼品包装税
        /// </summary>
        public string taxRefundedGiftWrap { get; set; }
        /// <summary>
        /// 销售税退款-买家运费税
        /// </summary>
        public string taxRefundedShipping { get; set; }
        /// <summary>
        /// 销售税退款-促销折扣税
        /// </summary>
        public string taxRefundedDiscount { get; set; }

        /// <summary>
        /// 销售税退款-商品价格税
        /// </summary>
        public string taxRefundedProduct { get; set; }

        /// <summary>
        /// 监控信息
        /// </summary>
        public alarmInfo alarmInfo { get; set; }
        /// <summary>
        /// 监控指标
        /// </summary>
        public string profitMetric { get; set; }
        /// <summary>
        /// 数值类型
        /// </summary>
        public string valueType { get; set; }
        /// <summary>
        /// 比较类型
        /// </summary>
        public string compareType { get; set; }
        /// <summary>
        /// 比较值
        /// </summary>
        public string compareValue { get; set; }


    }
    public class alarmInfo
    {
        /// <summary>
        /// 监控指标
        /// </summary>
        /// 
        private string _profitMetric;
        public string profitMetric 
        {
            get { return _profitMetric; }
            set 
            { 
                if (value == "amount") _profitMetric = "销售额";
                else if (value == "gross") _profitMetric = "毛利润";
                else if (value == "gross_percent") _profitMetric = "毛利率";
                else if (value == "ads_sped") _profitMetric = "广告费";
                else if (value == "ads_sped_percent") _profitMetric = "广告费占比";
                else if (value == "warehouse_sped") _profitMetric = "仓储费";
                else if (value == "warehouse_sped_percent") _profitMetric = "仓储费占比";
                else _profitMetric=value;
            }
        }
        /// <summary>
        /// 数值类型
        /// </summary>
        private string _valueType;
        public string valueType
        {
            get { return _valueType; }
            set
            {
                if (value == "absolute") _valueType = "绝对值";
                else if (value == "percent") _valueType = "百分比";
                else _valueType = value;
            }
        }
        /// <summary>
        /// 比较类型
        /// </summary>
        public string compareType { get; set; }
        /// <summary>
        /// 比较值
        /// </summary>
        public string compareValue { get; set; }

    }


    public class estimateFeeStr
    {
        /// <summary>
        /// 费用id
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 费用名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 费用金额
        /// </summary>
        public string amount { get; set; }

    }
}
